<?php

class Application_Model_Rates extends Zend_Db_Table_Abstract
{
    protected $_name = 'rates';
    
    public function getAllRates() {
        $select = $this->select()->from($this->_name);
        return $this->fetchAll($select);
    }
    
    public function updateRate($id, $data) {
        $this->update($data, 'id =' . intval($id));
    }
    
    public function addRate($data) {
        $this->insert($data);
    }
    
    public function deleteRate($id) {
        $this->delete('id =' . intval($id));
    }
    
    public function getSelectRate($id) {
        $select = $this->select()->from($this->_name)
                       ->where('id =?', intval($id));
        return $this->fetchRow($select)->toArray();
    }
}

